package com.example.zhaoyulu.yunzhiapp.fragement;

import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.example.zhaoyulu.yunzhiapp.R;

import static android.widget.Toast.LENGTH_LONG;

/**
 * Created by zhaoyulu on 5/9/18.
 */

public class gerenxinxiFragment extends Fragment {

    TextView gerenkebiao;
    TextView jinqihuodong;
    TextView chengjichaxun;
    TextView xuexijindu;

    @SuppressLint("WrongViewCast")
    void initView(View view){
        gerenkebiao=view.findViewById(R.id.gerenkebiao);
        jinqihuodong=view.findViewById(R.id.jinqihuodong);
        chengjichaxun=view.findViewById(R.id.chengjichaxun);
        xuexijindu=view.findViewById(R.id.xuexijindu);

        gerenkebiao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getActivity(),"1",LENGTH_LONG).show();
            }
        });
        jinqihuodong.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getActivity(),"2",LENGTH_LONG).show();
            }
        });
        chengjichaxun.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getActivity(),"3",LENGTH_LONG).show();
            }
        });
        xuexijindu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getActivity(),"4",LENGTH_LONG).show();
            }
        });

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //引用创建好的xml布局
        View view = inflater.inflate(R.layout.maingerenxinxifragment,container,false);
        initView(view);
        return view;
    }
}
